package com.sanji.sjmallmodule.goods;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.sanji.sjmallapp.R;
import com.sanji.sjmallwidget.XListView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/****
 * 配件fragment的adapter
 *****/
public class GoodsPartsFramentAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private List<GoodsTypeBean> goodsParts;

    public GoodsPartsFramentAdapter(FragmentManager fm, List<Fragment> fragments, List<GoodsTypeBean> goodsParts) {
        super(fm);
        this.fragments = fragments;
        this.goodsParts = goodsParts;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return this.goodsParts.get(position).getGoodsTitle();
    }
}
